<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

	<table border="1">
		<c:if test="${sessionScope.user != null }">
			<h2>欢迎登陆,${user.name}</h2>
		</c:if>
		<tr><th>ID</th><th>电影名称</th><th>电影编号</th><th>分类</th><th>导演</th><th>上映时间</th><th>编辑</th></tr>
		<c:forEach var="m" items="${movies}">
		<tr><td>${m.id}</td>
			<td>${m.title}</td>
			<td>${m.movieCode}</td>
			<td>${m.category.name}</td>
			<td>${m.director}</td>
			<td><fmt:formatDate pattern="yyyy-MM-dd" value="${m.dateReleased}"/></td>
			<td><a href="admin/edits?id=${m.id}">编辑</a></td>
		</tr>
		</c:forEach>
	</table>
